using Common.Communal;
using MediatR;
using Sell.Api.Write.Application.Command.PhrasesCommand;
using Sell.Services.Phrases;

namespace Sell.Api.Write.Application.CommandHandlers.PhrasesCommandHandlers
{
    public class PhrasesUpdateReviewStatusCommandHandler : IRequestHandler<PhrasesUpdateReviewStatusCommand, ApiResult<int>>
    {
        private readonly IPhrasesServices _phrasesServices;

        public PhrasesUpdateReviewStatusCommandHandler(IPhrasesServices phrasesServices)
        {
            _phrasesServices = phrasesServices;
        }

        /// <summary>
        /// 修改销售合同审核状态
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public async Task<ApiResult<int>> Handle(PhrasesUpdateReviewStatusCommand request, CancellationToken cancellationToken)
        {
            return await _phrasesServices.UpdateReviewStatus(request.Id, request.ReviewStatus);
        }
    }
}





